Repository navigation
Conversation
ZhangZhenhaoUPM
added a commit
to ZhangZhenhaoUPM/DeepCode
that referenced
this pull request
Nov 9, 2025
Problem: - _call_llm_with_tools was called every iteration (up to 800 times) - Each call logged full routing info using WARNING level - Caused massive log spam with identical messages - Model switches were being logged even when no switch occurred Solution: 1. Track last logged state (_last_logged_task_type, _last_logged_model) 2. Only log when task type or model actually changes 3. Count and report total model switches at completion 4. Move detailed routing config to workflow start (log once) 5. Change from WARNING to INFO level (less noise) 6. Remove duplicate logs from _select_model_for_task Benefits: - Clean logs: Only see changes, not repetition - Performance: Less I/O overhead - Visibility: Model switch count shows optimization effectiveness - Debugging: Still see all important state transitions Example output (before): 🔍 TASK ROUTING CHECK: ... (800 times) ✅ Switched model: ... (800 times) Example output (after): 🔄 Task routing configuration: ... (once at start) 🔄 Task routing: code_generation → qwen3-coder:30b (only on change) ✅ Model switch HKUDS#1: qwen3:32b → qwen3-coder:30b (only on actual switch) 📊 Total model switches during implementation: 15 (at end)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.